<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<table id="plan_task_table" class="table table-bordered">
</table>
<script type="text/javascript">
    $(function () {
        var plan_task_table = $('#plan_task_table').datagrid({
            height: '100%',
            width:'100%',
            fullGrid:true,
            columnMenu: false,
            contextMenuH:false,
            fieldSortable:false,
            gridTitle: '系统路径',
            showToolbar: true,
            toolbarItem: "refresh",
            filterThead: false,
            delPK: 'id',
            dataUrl: '/service/chain/indexPage',
            local: "remote",
            inlineEditMult: false,
            saveAll: false,
            addLocation: 'last',
            editUrl: '/admin/plan/task/save',
            columns: [
                {
                    name: 'name',
                    label: '名称',
                    align: 'center',
                    rule: 'required',
                    add: false
                }, {
                    name: 'status',
                    align: 'center',
                    label: '状态'
                }, {
                    name: 'orderNo',
                    align: 'center',
                    label: '订单号'
                }, {
                    name: 'result',
                    label: '结果',
                    align: 'center'
                }, {
                    render: operation,
                    label: '操作列'
                }
            ],
            paging: {pageSize: 100000, pageCurrent: 1},
            linenumberAll: true
        });

    });

    function operation(value, data) {
        var html = '<button type="button" class="btn-green" onclick="check(\'' + data.id + '\',\''+data.name+'\');">查看</button>';
        return html;
    }

   function check(id,name) {
//       /service/chain/checkChain
       BJUI.dialog({
           id:'dialog_'+id,
           url:'/service/chain/checkChain/'+id,
           title:name,
           width:800,
           height:600
       })

   }
</script>